package com.onejson.ojmall.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@ApiModel(description = "商品DTO")
public class ProductDTO {
    
    @ApiModelProperty("商品ID")
    private Long id;
    
    @NotBlank(message = "商品名称不能为空")
    @ApiModelProperty(value = "商品名称", required = true)
    private String name;
    
    @ApiModelProperty("商品描述")
    private String description;
    
    @NotNull(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格不能小于0")
    @ApiModelProperty(value = "商品价格", required = true)
    private BigDecimal price;
    
    @NotNull(message = "商品库存不能为空")
    @Min(value = 0, message = "商品库存不能小于0")
    @ApiModelProperty(value = "商品库存", required = true)
    private Integer stock;
    
    @ApiModelProperty("商品状态(0-下架，1-上架)")
    private Integer status;
} 